public class FruitBuilder {
    private Fruit fruit;
    public FruitBuilder setType(String typeCode) {
        Factory factory = new Factory();
        this.fruit = factory.CreateFruit(typeCode);
        return this;
    }
    public FruitBuilder addWashing() {
        if (fruit != null) {
            System.out.println("Washing " + fruit.getClass().getSimpleName());
        }
        return this;
    }
    public Fruit build() {
        return this.fruit;
    }
}
